# 构建django运行时环境
FROM centos:7
LABEL maintainer="kuangfeng05@163.com"

RUN yum install -y openssh-server sudo openssh-clients lrzsz net-tools which sudo openssl openssl-devel rsync  \
    kde-l10n-Chinese glibc-common vim gcc-c++ make python3 django 

RUN sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8

RUN echo "root:fdsafdsa" | chpasswd
RUN echo "root   ALL=(ALL)       ALL" >> /etc/sudoers

RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

RUN mkdir /var/run/sshd
ENV LC_ALL zh_CN.UTF-8
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

# docker build . -t centos7-ssh
# docker run -tid --name centos01 -p22:22 -p8000:8000 centos7-ssh
